export function getTimeDiff(timestamp) {
    const currentTime = new Date().getTime();
    const diff = currentTime - timestamp;
    
    const minute = 60 * 1000;
    const hour = 60 * minute;
    const day = 24 * hour;
    const month = 30 * day;
    
    if (diff < minute) {
        return Math.floor(diff / 1000) + '秒前';
    } else if (diff < hour) {
        return Math.floor(diff / minute) + '分钟前';
    } else if (diff < day) {
        return Math.floor(diff / hour) + '小时前';
    } else if (diff < month) {
        return Math.floor(diff / day) + '天前';
    } else if (diff < 3 * month) {
        return Math.floor(diff / month) + '月前';
    } else {
        return null;
    }
}